/* eslint-disable import/no-anonymous-default-export */
import React from "react";

import { Redirect } from "react-router-dom";

const Discover = React.lazy((_) => import("../pages/discover"));
const ranking = React.lazy((_) => import("../pages/discover/d-pages/ranking"));
const songs = React.lazy((_) => import("../pages/discover/d-pages/songs"));
const djradio = React.lazy((_) => import("../pages/discover/d-pages/djradio"));
const djRadioRecommend = React.lazy((_) =>
  import("../pages/discover/d-pages/djradio/recommend")
);
const djRadioRank = React.lazy((_) =>
  import("../pages/discover/d-pages/djradio/rank")
);
const djradioCategory = React.lazy((_) =>
  import("../pages/discover/d-pages/djradio/djradioCategory")
);
const artist = React.lazy((_) => import("../pages/discover/d-pages/artist"));
const album = React.lazy((_) => import("../pages/discover/d-pages/album"));
const recommend = React.lazy((_) =>
  import("../pages/discover/d-pages/recommend")
);
const mymusic = React.lazy((_) => import("../pages/myMusic/index"));
const friend = React.lazy((_) => import("../pages/friend/index"));
const download = React.lazy((_) => import("../pages/download/index"));
const playlistPage = React.lazy((_) =>
  import("../pages/discover/d-pages/playlistPage")
);
const djradioPage = React.lazy((_) => import("../pages/djRadio"));
const albumPage = React.lazy((_) => import("../pages/albumPage"));
const artistPage = React.lazy((_) => import("../pages/artist"));
const songPage = React.lazy((_) => import("../pages/songPage"));
const program = React.lazy((_) => import("../pages/program"));
const user = React.lazy((_) => import("../pages/user"));
const userHome = React.lazy((_) => import("../pages/user/u-pages/userHome"));
const userEvent = React.lazy((_) => import("../pages/user/u-pages/userEvent"));
const userFollows = React.lazy((_) =>
  import("../pages/user/u-pages/userFollows")
);
const userFans = React.lazy((_) => import("../pages/user/u-pages/userFans"));
const eventDetail = React.lazy((_) =>
  import("../pages/user/u-pages/eventDetail")
);
const levelPage = React.lazy((_) => import("../pages/my/level"));
const memberPage = React.lazy((_) => import("../pages/my/member"));

const myArtist = React.lazy((_) => import("../pages/myMusic/myArtist"));
const myMv = React.lazy((_) => import("../pages/myMusic/myMv"));
const createSongList = React.lazy((_) =>
  import("../pages/myMusic/createSongList")
);
const collageSongList = React.lazy((_) =>
  import("../pages/myMusic/collageSongList")
);

const mvList = React.lazy((_) => import("../pages/mv"));
const videoList = React.lazy((_) => import("../pages/video"));

export default [
  {
    path: "/",
    exact: true,
    render: () => <Redirect to="/discover" />,
  },
  {
    path: "/discover",
    component: Discover,
    routes: [
      {
        path: "/discover",
        exact: true,
        render: () => <Redirect to="/discover/recommend" />,
      },
      {
        path: "/discover/ranking",
        component: ranking,
      },
      {
        path: "/discover/songs",
        component: songs,
      },
      {
        path: "/discover/songs/:ids",
        component: songs,
        exact: true,
      },

      {
        path: "/discover/djradio",
        exact: true,
        component: djradio,
      },
      {
        path: "/discover/djradio/category",
        component: djradioCategory,
      },
      {
        path: "/discover/djradio/recommend",
        component: djRadioRecommend,
      },
      {
        path: "/discover/djradio/rank",
        component: djRadioRank,
      },
      {
        path: "/discover/artist",
        exact: true,
        component: artist,
      },
      {
        path: "/discover/artist/cat",
        component: artist,
      },
      {
        path: "/discover/album",
        component: album,
      },
      {
        path: "/discover/recommend",
        component: recommend,
      },
      {
        path: "/discover/playlist/:id",
        component: playlistPage,
      },
    ],
  },
  {
    path: "/djradio",
    component: djradioPage,
  },
  {
    path: "/album",
    component: albumPage,
  },
  {
    path: "/mymusic",
    component: mymusic,
    routes: [
      {
        path: "/mymusic",
        exact: true,
        render: () => <Redirect to="/mymusic/createSongList" />,
      },
      {
        path: "/mymusic/myArtist",
        component: myArtist,
      },
      {
        path: "/mymusic/myMv",
        component: myMv,
      },
      {
        path: "/mymusic/createSongList",
        component: createSongList,
      },
      {
        path: "/mymusic/collageSongList",
        component: collageSongList,
      },
    ],
  },
  {
    path: "/friend",
    component: friend,
  },
  {
    path: "/download",
    component: download,
  },
  {
    path: "/artist",
    component: artistPage,
  },
  {
    path: "/song",
    component: songPage,
  },
  {
    path: "/program",
    component: program,
  },
  {
    path: "/user",
    component: user,
    routes: [
      {
        path: "/user/home",
        component: userHome,
      },
      {
        path: "/user/event",
        component: userEvent,
      },
      {
        path: "/user/follows",
        component: userFollows,
      },
      {
        path: "/user/fans",
        component: userFans,
      },
    ],
  },
  {
    path: "/event",
    component: eventDetail,
  },
  {
    path: "/my/level",
    component: levelPage,
  },
  {
    path: "/member",
    component: memberPage,
  },
  {
    path: "/mv",
    component: mvList,
  },
  {
    path: "/video",
    component: videoList,
  },
];
